Learning Molecular Representation in a Cell

Predicting drug efficacy and safety in vivo requires information on biological responses (e.g., cell morphology and gene expression) to small molecule perturbations. However, current molecular representation learning methods do not provide a comprehensive view of cell states under these perturbations and struggle to remove noise, hindering model generalization. We introduce the Information Alignment (InfoAlign) approach to learn molecular representations through the information bottleneck method in cells. We integrate molecules and cellular response data as nodes into a context graph, connecting them with weighted edges based on chemical, biological, and computational criteria. For each molecule in a training batch, InfoAlign optimizes the encoder’s latent representation with a minimality objective to discard redundant structural information. A sufficiency objective decodes the representation to align with different feature spaces from the molecule’s neighborhood in the context graph. We demonstrate that the proposed sufficiency objective for alignment is tighter than existing encoder-based contrastive methods. Empirically, we validate representations from InfoAlign in two downstream tasks: molecular property prediction against up to 19 baseline methods across four datasets, plus zero-shot molecule-morphology matching.


Introduction
Drug properties, e.g., toxicity and adverse effects [25], are induced by molecular initiating events-interactions between a molecule and a biological system-that first impact the cellular level and ultimately influence tissue or organ functions [32].However, a chemical molecule's structure alone is insufficient information to predict its impact on cells: each chemical interacts with multiple cells and genes and induces complex changes in gene expression and cell morphology, making predictions of downstream responses challenging [5,33].Hence, molecular representation learning should make use of information about cellular response, enhancing the representation of the mode of action and thereby improving predictions for downstream bioactivity tasks [25,54].
Cells can be perturbed by treating them with chemicals or genetic reagents that disrupt a particular gene or pathway.These chemical and genetic perturbations in vitro naturally bridge molecules with cell morphology and gene expression, as illustrated in Figure 1 (b).However, multi-modal contrastive methods such as CLOOME [46] and InfoCORE [54], depicted in Figure 1 (a), focus primarily on aligning molecular representations with cell morphology [46,54] or gene expression [54].These approaches fall short in two ways.(1) They do not remove redundant information, grey-colored area in Figure 1 (b), that may harm representation generalization.The presence of redundant information [54] may induce spurious correlations, adversely affecting the generalization of molecular representations.For example, in small molecule perturbations [3,6], batch identifiers can signify confounding technical factors, creating misleading associations between molecular structures and cell morphology [54].(2) They treat molecules as the sole connectors between gene expression and cell morphology, ignoring the potential for genetic perturbations [6] to directly establish connections between these modalities.Genetic perturbations [6] not only enrich the feature space of gene expression and cell morphology but also enhance the navigation of molecular representation learning towards the overlapped (bottleneck) area in Figure 1 (b).
To address the aforementioned challenges, we conceptualize the cellular response processes as a context graph, capturing a more complete set of interactions among molecules, gene expression, and cell morphology.We identify the neighborhood of the molecule on the context graph and apply the information bottleneck [53] to optimize molecular representations, which aligns them with neighboring biological variables to remove redundant information and improve generalization.
We propose the Information Alignment (InfoAlign) approach, as presented in Figure 1 (b).InfoAlign uses one encoder and multiple decoders with information bottleneck for minimal sufficient statistics in representation learning.The minimality objective optimizes the encoder to learn the minimal informative representation from molecular structures by discarding redundant information.The sufficiency objective ensures the encoder retains sufficient information, allowing decoders to reconstruct features for biological variables in neighborhood areas of the context graph.We construct the context graph based on molecule and genetic perturbations [4,6,50] and introduce more biological (gene-gene interaction [16]) and computational (cosine similarity) criteria to increase edge connectivity.We conduct random walks on the context graph, beginning with the molecule in the training batch, to identify its neighborhood.Cumulative edge weights indicate similarity between the molecule and variables along the path.The molecule is encoded, and its latent representation is decoded to align with features identified in the random walk.Encoders and decoders are jointly optimized using an upper bound for the minimality objective and a lower bound for the sufficiency objective.
The sufficiency objective introduces a decoder-based bound for multi-modal alignment.We show its theoretical advantages by demonstrating that it provides a tighter bound than the encoder-based approaches used in previous contrastive methods [36,40], as discussed in Section 4.3.In experiments, InfoAlign outperforms up to 27 baselines across three classification and one regression dataset, covering 685 tasks, with average improvements of up to 6.4%.InfoAlign also demonstrates strong zero-shot multi-modal matching on two molecule-morphology datasets.

Related Work
Representation Learning on Molecular Structure: Representation learning approaches for molecules can be categorized into sequential-based [24,45] or graph-based models [18,60,62,27].Sequential models, utilizing string formats of molecules like SMILES and SELFIES [24], have evolved from Recurrent Neural Networks (RNNs) to Transformers [7,45].These models typically follow specific pretraining strategies similar to language models such as BERT [9], RoBERTa [30,7] and GPT [39].The pretraining targets are thus often the next token predictions or mask language modeling [9,7] on SMILES or SELFIES sequences [39].Graph Neural Networks (GNNs) are the architectures for graph-based approaches [18,60,62,29], where methods to pretrain GNNs often perturb or mask the atoms, edges, or substructures of molecular graphs with contrastive [18,60] and predictive losses [62,21].Recent evidence highlights the challenges of developing universal molecular representations based solely on molecular structures without integrating domain knowledge [3,47,51,48,28].Although using motifs is a common method to incorporate such knowledge [44,21], the incorporation of information about molecules' biological impacts is much less explored.We aim to enhance molecular representation learning by incorporating domain knowledge from cellular response data.
Representation Learning with Different Modalities: Existing methods on multimodal alignment, such as CLIP [40], primarily address pairwise relationships between texts and images and use methods like InfoNCE [36,54,46].These approaches use separate encoders for different modalities to compute contrastive loss, which is upper bounded by the number of negative examples [38].Subsequent research on molecules similarly focuses on pairwise alignment between molecules and cell images [46,54], molecules and protein sequences [20], and molecules and text [10,22].Although BioBridge [57] handles multiple modalities, it leverages a knowledge graph for transforming representations between modalities rather than optimizing molecular representations.
Representation Learning with Cellular Response Data: A primary goal of molecular representation learning is to predict molecular bioactivity.Likewise, emerging gene expression [50] and morphological profiling approaches [5,49] that describe perturbed genetic or cellular states in cell cultures can also be used to predict bioactivity.In some datasets, molecules are the perturbations, and the perturbed cell states measured are gene expression values for a thousand or more genes [50] and/or microscopy Cell Painting images, which can be represented as a thousand or more morphology features [8].Recently created large-scale perturbation datasets [3,50,6] could enrich molecular representation learning approaches.CLOOME [46] and MoCoP [34] contrast cellular images with molecules and InfoCORE [54] contrasts molecule with either morphological profiling [4] or gene expression [54].InfoCORE [54] aims to mitigate confounding batch identifiers, but its effectiveness depends on a batch classifier, which is impractical without batch identifiers.We integrate cellular response data and molecules into a context graph to capture cellular response patterns, focusing on learning molecular representations to remove nuisances [52].

Problem Definition
We denote x ∈ X as the molecule from the space X .An encoder with parameters p θ (z | x) maps x to a D-dimensional latent representation z ∈ R D .One may implement a Graph Neural Network (GNN) [58] as the encoder.The GNN first updates node representations and then performs a readout operation (e.g., summation) over the nodes to obtain the latent representation.
Existing research has extensively used structural features to pretrain the GNN encoder [18,21].However, incorporating more expressive features from the cellular context, such as cell morphology and gene expression, remains largely unexplored for improving molecular representations.In this work, we use these features as targets to optimize molecular representations.

Multi-modal Alignment with InfoAlign
We present the overall representation learning framework in Figure 2. In Section 4.1, we construct the context graph for cellular response data.In Section 4.2, we introduce representation learning methods based on the principle of minimal sufficiency for molecules and their related modalities.In Section 4.3, we demonstrate the theoretical advantages of the proposed method.

Random Walks on Cellular Context Graph
Node Construction: We model the interactions of the molecule x with other molecules, the cell c, and genes e using the context graph.They are nodes with different features y.Molecular features are vectors obtained using fingerprint [43].Cell morphology features are vectors derived from CellProfiler [5] applied to Cell Painting microscopy images.Gene expression features are scalars using L1000 [50] methods.We further rescale the feature spaces to a range between 0 and 1.
Edge Construction: We link nodes using various chemical, biological, and computational criteria.For example, molecules can perturb cultured human cells, inducing changes in cell morphology [6] and gene expression [50], thus linking them to cell morphology and gene expression nodes.Genes could also perturb cells, inducing links between genes and cell morphology [6].Additionally, we calculate cosine similarity within the same feature space and use biological criteria such as gene-gene interactions [16] to enrich the edge space.Each edge is assigned a weight w with a value between 0 and 1.We construct the context graph with details Section 5.An example is provided in Figure 2 (a).

Random Walk Path Extraction:
The context graph identifies related cellular response patterns for input molecules in representation learning.Given an input molecule x, we extract its neighborhood through random walks starting from x. Specifically, we employ degree-based transition probabilities [37] and denote the walking path as P x : To quantify the similarity between x and node v i (2 ≤ i ≤ L) on P x , we compute the cumulative product of edge weights as α

Optimization for Representation with Information Bottleneck
The information bottleneck (IB) [53,1] is an appealing method for defining concise representations with strong predictive power.For molecular representation, we extract minimal sufficient information from the random variable X of molecules.This is achieved by aligning the molecular representations Z with the targets Y , derived from node features along the walk path P. The IB has two principles based on mutual information (MI): (1) the minimality principle, which minimizes MI between molecules and their latent representations as I(X; Z), and (2) the sufficiency principle, which decodes latent representations to maximally reconstruct feature spaces for variables along the walk path I (Z; Y ).Together, these form the optimization objectives: where β controls the trade-off between minimality and sufficiency.The exact computation of I(Z; Y ) and I(X; Z) is intractable due to the unknown conditional distribution p(y|z) and the marginal p(z).
We introduce the variational approximations q(y|z) and q(z) for them, respectively.This results in a lower bound estimation for the first decoding term I DLB and an upper bound for the second encoding term I EU B [38].
H(Y ) is the differential entropy.Proofs are in appendix A.1.Together, I DLB and I EU B upper bound Eq. ( 1), forming a tractable objective −I DLB + I EU B to optimize the encoder.For the target Y , the I DLB objective requires decoders rather than encoders, as typically used in prior work [46].We use distinct decoders, denoted as q ϕ with parameters ϕ, for various targets, including molecular fingerprints, gene expressions, and cell morphology features.
After ignoring the constant terms, one could formulate the loss function according to Eq. ( 2) for the molecule sample x, its latent representation z, and the targets y v from P x : where the first term aligns the representation with other features, and KL is the Kullback-Leibler divergence used for regularization.N (0, I) is the The Gaussian prior.In this formulation, the encoder models a distribution instead of a single representation z, learning the mean and variance µ, σ ∈ R D .One may use parameterization tricks to sample z from the distribution [1].The decoder then reconstructs y v , the features of the neighboring node v on the context graph.
InfoAlign uses multiple decoders for q ϕ to align multi-modal features, while prior work relies on encoders with CLIP-like losses to align the latent space [40,14,54,46].Next, we provide the theoretical benefits of decoder-based alignment alongside the empirical advantages in Section 6.

Theoretical Motivation for Decoder-based Alignment
InfoNCE [36] is the contrastive loss used for most CLIP-like methods [40,54].In this work, we show that the MI lower bound based on InfoAlign is tighter than that based on InfoNCE.Proposition 4.1.For the molecular representation Z and target Y (from cell morphology, gene expressions, or molecular fingerprints), the encoder-based MI lower bound I ELB for InfoNCE can be derived by incorporating K − 1 additional samples, denoted as y 2:K , to build the Monte Carlo estimate m(•) of the partition function [35,38]: where h(z, y) is the neural network parameterized critic for density approximation with the energybased variational family.The decoder-based lower bound I DLB is defined in Eq. ( 2), then we have that I DLB is tighter than I ELB , i.e., I(Z; Y Proofs are in appendix A.2.The result aligns with empirical observations in previous studies such as DALL-E 2 [41], where a prior model was introduced to improve representations from CLIP [40] before decoding to another modality.In this work, we learn decodable latent representations from molecules to align with different biological features.(2) Hetionet [16], which captures gene-gene and gene-molecule relationships from millions of biomedical studies; and (3) a dataset reporting differential gene expression values for 978 landmark genes [56] for chemical perturbations (molecule and gene expression pairs) [50].
Node Features: Different profiling methods provide node features in different ways.Morgan fingerprints [43] are feature vectors extracted from each molecule's structure, CellProfiler features [5] are computed from the image of each cell and represent cell morphology, and L1000 profiles [50] capture gene expression values on 978 landmark genes from cells treated with a chemical perturbation.
Here are two practical considerations for the context graphs: (1) Chandrasekaran et al. [6] provided one dataset that measured the cell morphology impacts of perturbing individual genes.The 15K genetic perturbations [6] provide gene-cell morphology pairs but lack corresponding gene expression profiles.Still, we keep the gene nodes from this dataset to account for potential gene-gene interactions and incorporate cell morphology features into them.(2) All 978 landmark genes have expression values linked to the molecules used in [56].We update new gene expression nodes with 978dimensional feature vectors.These vectors summarize all molecule-gene expression connections for a small molecule perturbation.This approach efficiently reduces dense connections between landmark genes and molecules.We select the top 1% of gene-molecule expression values as new edges to enrich the context graph's connectivity.We scale cell morphology and gene expression features to a range of 0 to 1 using the Min-Max scaler along each dimension.
Edge Weights: For edges based on chemical perturbations [4,6], we assign the edge weight of 1.We also compute cosine similarity for nodes if they are in the same feature space (such as two cell morphology/gene expression profiles, or Morgan fingerprints).To avoid noisy edges from computations, we apply a 0.8 threshold for cosine similarity, and additionally explicitly enforce 99.5% sparsity by selecting top similar edges.
All together, this results in a context graph of 276,855 nodes (129,592 molecules, 4533 genes + 13,795 gene expressions, and 128,935 cell morphology) and 366,384 edges.
Encoder and Decoder: We use the Graph Isomorphism Model (GIN) [58] as the molecule encoder.All molecules on the context graph are used to pretrain the encoder.Because we extract feature vectors as the decoding targets in different modalities, we could efficiently use Multi-Layer Perception (MLP) as modality decoders.In each training batch, random walks start from the molecule node to extract the walk path.Then, decoders are pretrained to reconstruct corresponding node features from nodes over the path.More details are in appendix B.

Experiments
We focus on three research questions (RQs) regarding InfoAlign's representation for molecular property prediction, molecule-morphology matching, and performance analysis.
The dataset statistics are in Table 1, covering 685 tasks.We apply scaffold-splitting for all datasets.
We follow [19] for the ToxCast dataset, and a 0.6:0.15:0.25 ratio for training, validation, and test sets  Pretrained GNN AttrMask [18] 73.9±0.5 [46] and InfoCORE [54] for multi-modal alignment using structure, morphology, and gene expression data.We use MLPs, Random Forests (RF), and Gaussian Processes (GP) for methods in categories (1,4,5).We fine-tune MLPs on various representation learning approaches for predicting molecular properties.Setting details and all results are in appendices C.1 and C.3.

Results and Analysis
We present results across various assays in Tables 2 and 3 and Figure 3. Key observations include: (1) Molecular structures are superior compared to cell morphology and gene expression features for predicting various molecular assays.This is likely because the datasets and tasks we selected fundamentally involve predicting the binding affinity of a molecule to a protein [13]; furthermore, in these datasets, molecules with activity in a given assay tend to have highly related structures, rather than representing two or more structurally distinct classes of molecules with activity; together this implies that molecular structure alone will tend to yield strong results.When comparing the three popular structure-based representation approaches, no single method outperforms the others across all four datasets.Pretrained GNNs generally perform better than fingerprint-based methods and pretrained chemical language models, thanks to recent advancements.However, continued efforts in universal structural representation are still necessary.
(2) Cell morphology and gene expression features may complement molecular structures, yielding more generalizable representations.As shown in Figure 3, cell morphology and gene expression outperform molecular structure in approximately 20% and 10% of tasks on the ChEMBL2K and Broad6K datasets, respectively.This suggests that incorporating cell context into representation learning would be beneficial.That said, existing multi-modal baselines (InfoCORE, CLOOME) only outperform molecular structure-based approaches on ChEMBL2K and ToxCast, as they do not construct molecular representations holistically by using all cell-related modalities.
(3) InfoAlign achieves the best average performance on all tasks compared to 27 baselines.The improvements from InfoAlign range from 2.5% to 6.4% on average across four datasets compared to the second-best method.These gains are more significant when using the 80% AUC threshold on classification datasets.While InfoCORE (GE) performs best among baselines on the ChEMBL2K and ToxCast datasets, it struggles to align molecular representations with more than two modalities and sometimes leads to negative transfer, as seen in Broad6K and Biogen3K.

Experimental Setting
We evaluated zero-shot matching performance of various methods for predicting cell morphology from query molecules, including baselines CLOOME and InfoCORE (CP) with pretrained encoders.
For retrieval, we calculate the cosine similarity between the molecular representation and all cell morphology candidates, rank these candidates, and compute Normalized Discounted Cumulative Gain   (NDCG) and HIT scores for the top-1 and top-10 candidates as metrics.To ensure a fair evaluation of zero-shot matching, we exclude the cell morphology data for molecules that were used to train the baseline encoders.Consequently, we have 80 molecule-cell morphology pairs from ChEMBL2K and 196 pairs from Broad6K.All the morphology data are used as candidates for matching.
For InfoAlign, we use the pretrained decoder from Section 5 to extract the morphology features of the encoded molecule and then calculate the likelihood of these decoded features against the candidate morphology data.We then rank the candidates in the decoding space based on their likelihood scores.

Results and Analysis
Cross-modal matching results are in Table 4. InfoAlign outperforms InfoCORE on ChEMBL2K and is comparable to InfoCORE on Broad6K, with both surpassing CLOOME.Additionally, we visualized the distribution of ranking positions for correct matching pairs to compare overall retrieval performance.The results show that InfoAlign and InfoCORE perform similarly, while CLOOME consistently ranks correct pairs lower.

Ablation Studies
We perform ablation studies on Eq. ( 3) by pretraining encoders with different targets removed: (1) molecule-related, (2) cell morphology-related, and (3) gene expression-related features.The results in Table 5 cover all datasets.We observe that both cell morphology and gene expression features are crucial for achieving the best performance.Different biological targets have varying impacts across datasets: molecular structure has more influence on Broad6K and Biogen3K, while gene expression is more important for ChEMBL2K and ToxCast.
Table 5: Ablation studies on the pretraining loss.Different node features are removed from the context graph to assess their impact on downstream tasks.Avg.AUC is reported.Figure 4: Analysis on the hyperparameters: strength of prior β and random walk length L. AUC is computed on the test set of ChEMBL2K.

Hyperparameter Analysis
Lastly, we perform analysis for the hyperparameters: the strength of the regularization to the prior Gaussian distribution β and the length of the random walk paths L. Results are presented in Figure 4.
We observe a trade-off between the principles of minimality and sufficiency in Figure 4a: a too-high β value (minimal information) makes it challenging for the representation to be sufficiently expressive for molecular, gene expression, and cell morphology features, potentially degrading downstream performance.Conversely, a too-low β value weakens minimality and may impair generalization.The convergence of the pretraining loss could serve as a good indicator to balance these aspects.For the hyperparameter L, we observe in Figure 4b that downstream performance on ChEMBL2K is relatively robust across a wide range of walk lengths.

Conclusion
In this work, we proposed learning molecular representations in a cell context with three modalities: molecular structure, gene expression, and cell morphology.We introduced the information bottleneck approach, InfoAlign, using a molecular graph encoder and multiple MLP decoders.InfoAlign learned minimal sufficient molecular representations extracted by reconstructing features in the random walk path on a cellular context graph.This context graph incorporated molecules, cell morphology, and gene expression information defined in scalar or vector spaces to construct nodes, and used various chemical, biological, and computational criteria to define their weighted edges.We demonstrated the theoretical and empirical advantages of the proposed method.InfoAlign outperformed other representation learning methods in various molecular property prediction and zero-shot moleculemorphology matching tasks.

A Proof Details
A.1 Proof of Eq. ( 2) For the input, latent, and target variables X, Z, and Y , the exact computation of the mutual information (MI) I(Z; Y ) and I(X; Z) is intractable.For the molecule x, its latent representation z, and any biological target from cellular responses y, we introduce variational approximations q(y|z) to obtain a lower bound on I(Z; Y ): I(Z; Y ) = E p(z,y) log p(z, y)q(y|z) p(y)p(z)q(y|z) , = E p(z,y) log q(y|z) p(y) This is because that KL (p(y|z)∥q(y|z)) ≥ 0. We introduce the variational approximations q(z) for a upper bound on I(X; Z): I(X; Z) = E p(x,z) log p(x, z)q(z) p(x)p(z)q(z) , A.2 Proof of proposition 4.1 For the molecule x, its latent representation z, and any biological target from cellular responses y, we use the neural network parameterized critic h(z, y) with the energy-based variational family for density approximation [38]: E p(y) e h(z,y) e h(z,y) .Thus, we can rewrite I DLB based on the unnormalized distribution of q(y|z): E p(y) e h(z,y) e h(z,y) − E p(y) [log p(y)] , where Z(z) = E p(y) [e h(z,y) ] is the partition function.
Note that the log partition function is intractable.Poole et al. [38] introduced a new variational parameter a(•) to upper bound Z(z), deriving a tractable lower bound for I DLB : This is because ∀x, a > 0, the inequality log(x) ≤ x a + log(a) − 1 holds, which can be applied to the second term of Eq. (7).The I N W J bound [35]  Suppose there are K − 1 additional examples independently and identically sampled and denoted as y 2:K , and the critic is configured with parameters a(•) as 1 + log e h(z,y) a(z;y,y 2:K ) .Then, we can rewrite I N W J for its multi-sample version: I N W J = E p(z,y)p(y 2:K ) 1 + log e h(z,y) a(z; y, y 2:K ) − e −1 E p(y)p(z)p(y 2:K ) e 1+log e h(z,y) a(z;y,y 2:K ) , = 1 + E p(z,y)p(y 2:K ) log e h(z,y) a(z; y, y 2:K ) − E p(y)p(y 2:K )p(z) e h(z,y) a(z; y, y 2:K ) .
Multiple samples can be utilized for the Monte Carlo method m(z; y, y 2:K ) to estimate the upper bound on the partition function a(z; y, y 2:K ): where K − 1 independent samples are drawn from i p(y i ) and one sample from p(z, y) for the term E p(z,y)p(y 2:K ) [•] or K samples from K i=1 p(y i ) (we set y 1 = y) for a p(z) sample in the E p(y)p(y 2:K ) [•] term.Therefore, we can derive I ELB ≜ I N CE : e h(z,yi) .
(11) Note that for E p(y)p(y 2:K )p(z) [•], we average the bound over K replicates as well to ensure that the last term in Eq. ( 10) is the constant 1.Now, I ELB or I N CE is upper bounded by log K, rather than a(•).Hence, the difference between I DLB and I ELB is When K is sufficiently large to estimate the partition function, we have E p(z) log E p(y) e h(z,y) for the left term, indicating that I DLB − I ELB = 0. Since I N CE is upper bounded by log K [36], smaller values of K may result in a less tight I ELB , causing I DLB − I ELB ≥ 0 to always hold.In particular, I(Z; Y ) > log K implies that the bound I ELB will be loose.

B Context Graph Details B.1 Edge Construction
Edges represent similarity relationships between molecules, genes and cells.According to the chemical or biological criteria, we have following types of edges: 1. Molecule-Cell Morphology Edges: These edges are introduced through molecule perturbation experiments from cell painting datasets created by [3] and the JUMP dataset [6].It links molecule nodes with cell morphology nodes.We use the edge weight 1 for all these edges.2. Edge-Cell Morphology Edges: These edges should be introduced by genetic perturbation from the JUMP dataset [6].The perturbations are either based on gene overexpression (ORF) or gene knockout techniques (CRISPR).They link the gene nodes and the cell morphology  Results for cell morphology and gene expression come from the best method based on MLPs.
• Molecule nodes: Molecular nodes sourced from two cell painting datasets: one by Bray et al. [4] and the other from the recently released JUMP dataset [6], and the third source from Wang et al. [56], which are used to study adverse drug reactions.
• Gene nodes: Gene nodes are from the landmark genes used by Wang et al. [56] in creating the LINCS L1000 profiling of drugs.Other gene nodes come from genetic perturbations in the JUMP dataset [6].The gene nodes from [6] have cell morphology features as described in appendix B.1.The landmark gene nodes from [56] have scalar gene expression profiles, but these values are updated in the new gene expression nodes.
• Cell morphology nodes: Cell nodes are sourced from the two cell painting datasets [3,6].
• Gene expression nodes: Based on landmark genes from [56], each gene expression node summarizes all gene expression profiles into vectors from a small molecule perturbation.Since Wang et al. [56] measured the same landmark genes for a set of molecules, we update new gene expression nodes with feature vectors for all these landmark genes.This approach efficiently constructs decoding targets from molecules to gene expression profiles and prevents redundant gene-molecule connections.
We present an example of the cellular context graph in Figure 5.

C Experiment Details C.1 Prediction Datasets
All experiments were run on a single 32G V100.Prediction dataset statistics are in Table 1: • ChEMBL2K [13]: The dataset is a subset of the ChEMBL dataset [13], overlapping with the JUMP CP [6] datasets.We determined activity using the "activity_comment" provided by ChEMBL.If not, we applied a threshold of 6.5, labeling compounds with pChEMBL  Results for cell morphology come from the best method based on RF. Results for gene expression are derived from the best method based on MLP.> 6.5 as active.We exclude all molecules in the dataset from the pretraining set to avoid data leakage.There are a total of 41 tasks related to protein binding affinity, which are converted to binary activity values.We filter the dataset to ensure that each task has at least one positive and five negative examples.• Broad6K [33]: The original version provided Moshkov et al. [33] is a collection of 16,170 molecules tested in 270 assays, resulting in a total of 585,439 readouts.However, there are a large number of missing values, with 153 assays having a missing value percentage above 99%.To mitigate bias in the conclusions, we extract subsets where the percentage is less than 50%.• ToxCast [42]: The toxicology data is collected from the "Toxicology in the 21st Century" initiative, widely utilized in many graph machine learning models [19].The dataset comprises 8,576 molecules and 617 binary classification tasks.• Biogen3K [11]: The dataset includes properties that describe the disposition of a drug in the body, including absorption, distribution, metabolism, and excretion (ADME).It is collected from 120 Biogen datasets across six ADME in vitro endpoints over 20 time points spanning about 2 years.The endpoints include human liver microsomal (HLM) stability reported as intrinsic clearance (Clint, mL/min/kg), MDR1-MDCK efflux ratio (ER), Solubility at pH 6.8 (µg/mL), rat liver microsomal (RLM) stability reported as intrinsic clearance (Clint, mL/min/kg), human plasma protein binding (hPPB) percent unbound, and rat plasma protein binding (rPPB) percent unbound.

Figure 1 :
Figure 1: Comparison of Representation Learning Methods: (a) Existing contrastive methods use two encoders-one for molecules and another for cell morphology or gene expression features-without sharing the molecule encoders for different alignment targets.(b) InfoAlign remove redundant information from molecules, cell morphology, and gene expressions based on the information bottleneck, resulting in more concise yet predictive molecular representations [1].

Figure 2 :
Figure 2: Molecular Representation Learning Using the Context Graph: (a) In Section 4.1, we construct the graph with various interaction, perturbation, and cosine similarities among molecules x, cell morphology profiles c, and genes e.Given a training batch of molecules, including x 1 and x 4 , random walk extracts paths, for instance, of length four.(b) In Section 4.2, we aim to learn molecular representations based on the information bottleneck, preserving minimal information from the input molecule while ensuring sufficient information for decoding the target along the walk path P x .

Figure 3 :
Figure 3: Percentage of Tasks Where Representations Excel: We compare the relative performance of three single representation (Single Rep.) approaches (molecular structure, cell morphology, and gene expression) and three aligned representations (Aligned Rep.): InfoAlign, CLOOME, InfoCORE.

1 =
is a special case where a(z) = e.I N W J ≜ E p(z,y) [h(z, y)] − E p(z) E p(y) [e h(z,y) ] e + log(e) − E p(z,y) [h(z, y)] − e −1 E p(z) [ Z(z)].(9)IN W J has high variance due to the estimation of the upper bound on the log partition function.Based on I N W J and multiple examples, one can derive the encoder-based lower bound I ELB for InfoNCE.

Figure 6 :
Figure 6: An overview of the representation's predictive performance on all 41 bioactivity prediction tasks in ChEMBL2K.Results for molecular structure are obtained from the best method ContextPred.Results for cell morphology and gene expression come from the best method based on MLPs.

Figure 7 :
Figure 7: An overview of the representation's predictive performance across five major task categories on Broad6K.Results for molecular structure are obtained from the best method based on JOAO.Results for cell morphology come from the best method based on RF. Results for gene expression are derived from the best method based on MLP.
5 Implementation of Context Graph and Pretraining Setting Data Source of Context Graph: We create the context graph based on (1) two Cell Painting datasets [4, 6], containing around 140K molecule perturbations (molecule and cell morphology

Table 2 :
Results on ChEMBL2K and Broad6K.We report average AUC (Avg.), as well as the percentage of tasks achieving AUC above 80%, 85%, and 90%.We highlight the best and second best mean.We also highlight the row of the best method in each category.

Table 3 :
Results on ToxCast and Biogen3K.We report the average AUC and the percentage of AUC above 80% on ToxCast, and regression MAE (scaled by × 100) for Biogen3K.We highlight the best and second best mean.We also highlight the row of the best method in each category.

Table 4 :
Retrieval results on ChEMBL2K (top) and Broad6K (bottom): Left tables display ranking metrics for top candidates.Right figures visualize the distribution of rankings for the correct matching.